using I2.Loc;
using UnityEngine;

public class CaseLang : MonoBehaviour
{
	public string key = string.Empty;

	public UISprite sprImg;

	public UILabel lbLang;

	public SwitchLanguage swLang;

	private string _defaultSprite;

	private BoxCollider _collider;

	public string DefaultSprite
	{
		get
		{
			if (_defaultSprite == null)
			{
				UIButton component = base.gameObject.GetComponent<UIButton>();
				_defaultSprite = component.normalSprite;
			}
			return _defaultSprite;
		}
		set
		{
			_defaultSprite = value;
		}
	}

	private void OnClick()
	{
		swLang.SetLang(this);
	}

	public void RefreshColor()
	{
		UIButton component = base.gameObject.GetComponent<UIButton>();
		if (_collider == null)
		{
			_collider = GetComponent<BoxCollider>();
		}
		if (key == LocalizationManager.CurrentLanguage)
		{
			_collider.enabled = false;
			DefaultSprite = component.normalSprite;
			component.normalSprite = component.pressedSprite;
		}
		else
		{
			_collider.enabled = true;
			component.normalSprite = DefaultSprite;
		}
	}
}
